import requests
import json

url = "https://api.deepseek.com/chat/completions"

payload = json.dumps({
  "messages": [
    # {
    #   "content": "你是一个小学物理老师，尽量长篇大论",
    #   "role": "system" # 系统设置 角色 回复风格
    # },
    {
      "content": "你好",
      "role": "user"
    }
  ],
  "model": "deepseek-chat",
  "n": 1
})
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer sk-15ee706057da419db34a60b711e78d64'
}

response = requests.request("POST", url, headers=headers, data=payload)
print(response.status_code)
print(response.text)
print(response.json()['choices'][0]['message']['content'])